<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      function Person(uname) {
        this.uname = uname;
      }
      Person.prototype.sayHello = function () {
        console.log('你好，我叫' + this.uname);
      };
      var p1 = new Person('张三');
      var p2 = new Person('李四');
      console.log(p1.sayHello === p2.sayHello);	// 输出结果：true
      p1.sayHello();		// 输出结果：你好，我叫张三
      p2.sayHello();		// 输出结果：你好，我叫李四
    </script>
  </body>
</html>